<?php


class Login_Form_ResetPassword extends WSB_Xtension_Form
{

	/**
	 * Initialisierung
	 */
	public function init()
    {
    	$this->setName('reset-password');

    	// Password
		$element = new Zend_Form_Element_Password('password');
        $element->setLabel('loginPassword');
        $element->setRequired(true);
//        $element->addValidator($stringLengthValidator);
		$token = isset($_POST['confirmPassword']) ? $_POST['confirmPassword'] : '';
        $identicalValidator = new Zend_Validate_Identical($token);
        $identicalValidator->setMessages(array(
			Zend_Validate_Identical::NOT_SAME => 'loginPasswordsNotSame',
			Zend_Validate_Identical::MISSING_TOKEN => 'loginMissingToken'
        ));
        $element->addValidator($identicalValidator);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// Confirm password
		$element = new Zend_Form_Element_Password('confirmPassword');
        $element->setLabel('loginConfirmPassword');
        $element->setRequired(true);
//        $element->addValidator($stringLengthValidator);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// Button
        $element = new Zend_Form_Element_Submit('btnResetPassword');
        $element->setLabel('loginResetPassword');
        $element->setAttrib('class', 'submit-button-save');
		$this->addElement($element);

    }

}
